package auto.test.service;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.openqa.selenium.WebDriver;

import auto.test.base.BaseCase;

public class Addboth extends BaseCase{
	
	public HomeHandle homeHandle;
	public BothdetailHandle bothdetailHandle;

	//添加展位方法
	public void newboth(WebDriver driver,String bothnum) {
		
		homeHandle= new HomeHandle(driver);
		bothdetailHandle=new BothdetailHandle(driver);
		homeHandle.Clickfunctionbutton("functionbutton_zwgk");
		bothdetailHandle.clickadd();
		bothdetailHandle.inputboth(bothnum);
		bothdetailHandle.clickbothbutton();
		bothdetailHandle.clicknewboth();
		bothdetailHandle.sendinput("input_exnum",(bothnum));
		bothdetailHandle.clicktype();
	//	bothdetailHandle.choosebothtype(0);
		bothdetailHandle.choosebothtype("特装展位");
		bothdetailHandle.sendinput_area("input_area", "100");
		bothdetailHandle.sendinput("input_exhibitor", "自动化");
		bothdetailHandle.sendinput("input_contactname", "自动化");
		bothdetailHandle.sendinput("input_phone", "13129562261");
		bothdetailHandle.sendinput("input_mail", "553187951@163.com");
		bothdetailHandle.clicksubmit();
		
		assert bothdetailHandle.getresult().contains("已新增展位");
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public static String Getbothnum() {
		Date now = new Date();
		SimpleDateFormat dateFormat = new SimpleDateFormat("yyMMddHHmm");
		String currentDate = dateFormat.format(now);
		String bothnum="auto_"+currentDate;
		return bothnum;
	}

}
